﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.IO;
using System.Runtime.Serialization.Json;
using System.Text;

namespace _4SQ
{
    public partial class Profiles : PhoneApplicationPage
    {
        public Profiles()
        {
            InitializeComponent();
            
        }

      /*  private void GetFriends()
        {
            string ProviderURI = "https://api.foursquare.com/v2/users/15126026/friends?oauth_token=W3O44J0DALQC31JJYSN5SVRJQZ20X2GGNI2LEJDFWX0JC243&v=20120606";
            WebClient webClient = new WebClient();
            webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webClient_DownloadStringCompleted);
            webClient.DownloadStringAsync(new Uri(ProviderURI));
        }

        void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                return;
            }
            using (var stream = new MemoryStream(Encoding.Unicode.GetBytes(e.Result)))
            {
                DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(Friendies.RootObject));
                var providerResult = (Friendies.RootObject)dataContractJsonSerializer.ReadObject(stream);

                if (providerResult == null)
                {
                    //error
                }

                if (providerResult != null)
                {
                    //FriendBox.ItemsSource = providerResult.response.friends.items;
                    //FriendListControl. = providerResult.response.friends.items;
                }
            }
        }*/
         
    }
}